package com.leaderment.timatt;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;


/** 

* @author HankJone 

* @version 2019年1月11日 下午2:24:14 

* 应用启动后初始化的操作

*/
@Component
public class ApplicationInitializer implements ApplicationListener<ApplicationReadyEvent> {
	public static Logger log=Logger.getLogger(ApplicationInitializer.class);
	public static Properties prop=new Properties();
	// Redis的URL队列
	@Override
	public void onApplicationEvent(ApplicationReadyEvent event) {
		//读取config.properties
		InputStream in=this.getClass().getClassLoader().getResourceAsStream("config.properties");
		try {
			prop.load(in);
		} catch (IOException e) {
			e.printStackTrace();
		}
		log.info("start add ---------------------------------");
	}
}
